<template>
  <div class="province-manage">
    <ContentField>
      <template v-slot:header> 省份管理 </template>
      <template v-slot:body>
        <div></div>
        <div>
          <el-table :data="provinces" height="500" border style="width: 100%">
            <el-table-column prop="id" label="编号" width="180">
            </el-table-column>
            <el-table-column prop="name" label="名称"> </el-table-column>
          </el-table>
        </div>
      </template>
    </ContentField>
  </div>
</template>

<script>
import ContentField from "../../components/ContentField.vue";
export default {
  name: "ProvinceManageView",
  components: {
    ContentField,
  },
  created() {
    this.getProvinces();
  },
  methods: {
    handleClick() {},
    getProvinces() {
      let outer = this;
      this.$store.dispatch("getProvinces", {
        token: this.$store.state.user.jwt_token,
        success(resp) {
          outer.provinces = resp.data.data;
        },
        error(resp) {
          console.log(resp);
        },
      });
    },
  },
  data() {
    return {
      provinces: [],
    };
  },
};
</script>

<style scoped></style>
